package com.fs.web.yz.controller;


import com.fs.common.yzMapper.DiseaseMapper;
import com.fs.web.base.enums.CodeEnum;
import com.fs.web.base.vo.JsonResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * <p>
 * 症状 前端控制器
 * </p>
 *
 * @author ACE
 * @since 2019-08-02
 */
@Controller
@RequestMapping("/yz/disease")
public class DiseaseController {
    @Autowired
    private DiseaseMapper diseaseMapper;

    @RequestMapping("{status}/switchStatus")
    @ResponseBody
    public JsonResponse switchStatus(@PathVariable("status")String status, String id){
        try {
            int s = "0".equals(status)? 1 : 0;
            diseaseMapper.updateStatusById(s,id);
            return JsonResponse.success();
        } catch (Exception e) {
            e.printStackTrace();
            return JsonResponse.error(CodeEnum.EX999);
        }

    }

}
